package com.rainbow.demo.action;

import com.rainbow.demo.service.IQueryService;
import com.rainbow.formework.annotation.HMKAutowired;
import com.rainbow.formework.annotation.HMKController;
import com.rainbow.formework.annotation.HMKRequestMapping;
import com.rainbow.formework.annotation.HMKRequestParam;
import com.rainbow.formework.webmvc.HMKModelAndView;

import java.util.HashMap;
import java.util.Map;

/**
 * 公布接口url
 * @author Tom
 *
 */
@HMKController
@HMKRequestMapping("/")
public class PageAction {

	@HMKAutowired
	IQueryService queryService;
	
	@HMKRequestMapping("/first.html")
	public HMKModelAndView query(@HMKRequestParam("teacher") String teacher){
		String result = queryService.query(teacher);
		Map<String,Object> model = new HashMap<String,Object>();
		model.put("teacher", teacher);
		model.put("data", result);
		model.put("token", "123456");
		return new HMKModelAndView("first.html",model);
	}
	
}
